package com.sxz.sbs.module.client.presenter;

import com.sxz.sbs.app.App;
import com.sxz.sbs.module.client.bean.SelectStallBean;
import com.sxz.sbs.module.client.view.SelectStallView;
import com.sxz.sbs.rx.RxPresenter;
import com.sxz.sbs.rx.RxSubscriber;
import com.sxz.sbs.rx.RxUtil;

import java.util.HashMap;

/**
 * 选取车位
 * @author hp
 */
public class SelectStallPresenter extends RxPresenter<SelectStallView>{
    /**
     * @param map
     */
    public void getStallList (final HashMap<String,Object> map) {
        addSubscribe(App.getInstance().getApi().getSelectStall(map)
                .compose(RxUtil.<SelectStallBean>handleResult())
                .subscribeWith(new RxSubscriber<SelectStallBean>(mView){
                    @Override
                    public void onNext(SelectStallBean data) {
                       mView.onGetStallSuccess(data);
                    }
                })
        );
    }
}
